package com.ruoyi.analysis.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.analysis.mapper.OnlineHistoryZlbMapper;
import com.ruoyi.analysis.domain.OnlineHistoryZlb;
import com.ruoyi.analysis.service.IOnlineHistoryZlbService;

/**
 * 制粒二车间分析历史Service业务层处理
 * 
 * @author weihanqiang
 * @date 2025-06-19
 */
@Service
public class OnlineHistoryZlbServiceImpl implements IOnlineHistoryZlbService 
{
    @Autowired
    private OnlineHistoryZlbMapper onlineHistoryZlbMapper;

    /**
     * 查询制粒二车间分析历史
     * 
     * @param onlineResultId 制粒二车间分析历史主键
     * @return 制粒二车间分析历史
     */
    @Override
    public OnlineHistoryZlb selectOnlineHistoryZlbByOnlineResultId(Long onlineResultId)
    {
        return onlineHistoryZlbMapper.selectOnlineHistoryZlbByOnlineResultId(onlineResultId);
    }

    /**
     * 查询制粒二车间分析历史列表
     * 
     * @param onlineHistoryZlb 制粒二车间分析历史
     * @return 制粒二车间分析历史
     */
    @Override
    public List<OnlineHistoryZlb> selectOnlineHistoryZlbList(OnlineHistoryZlb onlineHistoryZlb)
    {
        return onlineHistoryZlbMapper.selectOnlineHistoryZlbList(onlineHistoryZlb);
    }

    /**
     * 新增制粒二车间分析历史
     * 
     * @param onlineHistoryZlb 制粒二车间分析历史
     * @return 结果
     */
    @Override
    public int insertOnlineHistoryZlb(OnlineHistoryZlb onlineHistoryZlb)
    {
        onlineHistoryZlb.setCreateTime(DateUtils.getNowDate());
        return onlineHistoryZlbMapper.insertOnlineHistoryZlb(onlineHistoryZlb);
    }

    /**
     * 修改制粒二车间分析历史
     * 
     * @param onlineHistoryZlb 制粒二车间分析历史
     * @return 结果
     */
    @Override
    public int updateOnlineHistoryZlb(OnlineHistoryZlb onlineHistoryZlb)
    {
        return onlineHistoryZlbMapper.updateOnlineHistoryZlb(onlineHistoryZlb);
    }

    /**
     * 批量删除制粒二车间分析历史
     * 
     * @param onlineResultIds 需要删除的制粒二车间分析历史主键
     * @return 结果
     */
    @Override
    public int deleteOnlineHistoryZlbByOnlineResultIds(Long[] onlineResultIds)
    {
        return onlineHistoryZlbMapper.deleteOnlineHistoryZlbByOnlineResultIds(onlineResultIds);
    }

    /**
     * 删除制粒二车间分析历史信息
     * 
     * @param onlineResultId 制粒二车间分析历史主键
     * @return 结果
     */
    @Override
    public int deleteOnlineHistoryZlbByOnlineResultId(Long onlineResultId)
    {
        return onlineHistoryZlbMapper.deleteOnlineHistoryZlbByOnlineResultId(onlineResultId);
    }
}
